how to take a key value pair from array of objects and create a new object from that key value pair